﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLiNhaSachBUS;

namespace QuanLiNhaSachGUI
{
    public partial class frmThongTinNguoiDung : Form
    {
        public frmThongTinNguoiDung()
        {
            InitializeComponent();
        }

        private void frmThongTinNguoiDung_Load(object sender, EventArgs e)
        {
            txtHoTen.Text = Auth.logged.Ten;
            txtCMND.Text = Auth.logged.CMND;
            txtDiaChi.Text = Auth.logged.DiaChi;
            txtEmail.Text = Auth.logged.Email;
            txtID.Text = Auth.logged.id;
            txtPassword.Text = Auth.logged.Password;
            txtSoDienThoai.Text = Auth.logged.SoDienThoai;
            txtUsername.Text = Auth.logged.Username;
            dateTimePicker1.Value = Auth.logged.NgaySinh;
            cbLoai.Text = Auth.logged.Loai;
            cbGioiTinh.Text = Auth.logged.GioiTinh;
        }

        private void btnLuu_Click(object sender, EventArgs e)
        {
            Auth.logged.NgaySinh = dateTimePicker1.Value;
            Auth.logged.GioiTinh = cbGioiTinh.Text;
            Auth.logged.Email = txtEmail.Text;
            Auth.logged.DiaChi = txtDiaChi.Text;
            Auth.logged.SoDienThoai = txtSoDienThoai.Text;
            Auth.logged.Password = txtPassword.Text;
            NhanVienBUS.update(Auth.logged);
        }

        private void frmThongTinNguoiDung_FormClosed(object sender, FormClosedEventArgs e)
        {
            frmMain.listForm.Remove(this);
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
